<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//登录页
Route::get('/admin/login', 'LoginController@index')->name('admin.login.index');
//登录提交
Route::post('/admin/login/login', 'LoginController@login')->name('admin.login.login'); 
Route::group(['prefix'=>'admin','middleware'=>'admin_auth'],function(){
	//错误日志
	Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index')->name('admin.logs.list');
    //env配置
	Route::get('/env/index','EnvController@index')->name('admin.env.index');
    Route::get('/env/data', 'EnvController@data')->name('admin.env.data');
    //编辑
    Route::get('/env/{id}/edit','EnvController@edit')->name('admin.env.edit');
    Route::put('/env/{id}/update','EnvController@update')->name('admin.env.update');

	//模块配置
	Route::get('/modules/index','ModulesController@index')->name('admin.modules.index');
    Route::get('/modules/data', 'ModulesController@data')->name('admin.modules.data');
	
	//编辑页面
	Route::get('/modules/{id}/edit','ModulesController@edit')->name('admin.modules.edit');
	Route::get('/modules/{id}/edit_data','ModulesController@edit_data')->name('admin.modules.edit_data');
	Route::put('/modules/{id}/modules_update','ModulesController@modules_update')->name('admin.modules.modules_update');
	


	//数据库管理
	Route::get('/data_base/index','DatabaseController@index')->name('admin.data_base.index');
    Route::get('/data_base/data', 'DatabaseController@data')->name('admin.data_base.data');
	
	Route::get('/data_base/table_detail','DatabaseController@table_detail')->name('admin.data_base.table_detail');
    Route::get('/data_base/table_data', 'DatabaseController@table_data')->name('admin.data_base.table_data');
	
	Route::post('/data_base/backup', 'DatabaseController@backup')->name('admin.data_base.backup');

	Route::get('/data_base/restore','DatabaseController@restore')->name('admin.data_base.restore');
    Route::get('/data_base/restore_data', 'DatabaseController@restore_data')->name('admin.data_base.restore_data');
	Route::get('/data_base/down_file', 'DatabaseController@down_file')->name('admin.data_base.down_file');
	Route::delete('/data_base/del_sql_files', 'DatabaseController@del_sql_files')->name('admin.data_base.del_sql_files');






















    //首页
    Route::get('/index','IndexController@index')->name('admin.index.index');
    //控制面板
    Route::get('/index/main', 'IndexController@main')->name('admin.index.main');
	//退出登录
    Route::get('/index/logout', 'IndexController@logout')->name('admin.index.logout');
	//修改密码
	Route::get('/index/upadte_pwd_view','IndexController@upadte_pwd_view')->name('admin.index.upadte_pwd_view');
	Route::put('/index/{id}/upadte_pwd','IndexController@upadte_pwd')->name('admin.index.upadte_pwd');
	
    //清除缓存
    Route::get('/index/clear', 'IndexController@clear')->name('admin.index.clear');
	
	//单图图上传
	Route::post('/upload/upload_file', 'UploadController@upload_file')->name('admin.upload.upload_file');
	
	//管理员管理
	Route::get('/admin/index','AdminController@index')->name('admin.admin.index'); 
	Route::get('/admin/data', 'AdminController@data')->name('admin.admin.data');
	//添加
	Route::get('/admin/create','AdminController@create')->name('admin.admin.create');
	Route::post('/admin/store','AdminController@store')->name('admin.admin.store');
	//编辑
	Route::get('/admin/{id}/edit','AdminController@edit')->name('admin.admin.edit');
	Route::put('/admin/{id}/update','AdminController@update')->name('admin.admin.update');
	//调整状态
	Route::put('/admin/{id}/status','AdminController@status')->name('admin.admin.status');
	//初始化密码
	Route::put('/admin/{id}/update_pwd','AdminController@update_pwd')->name('admin.admin.update_pwd');
	//单个删除
	Route::delete('/admin/destroy','AdminController@destroy')->name('admin.admin.destroy');
	
	
	//权限组管理
	Route::get('/auth_group/index','AuthGroupController@index')->name('admin.auth_group.index'); 
	Route::get('/auth_group/data', 'AuthGroupController@data')->name('admin.auth_group.data');
	//添加
	Route::get('/auth_group/create','AuthGroupController@create')->name('admin.auth_group.create');
	Route::post('/auth_group/store','AuthGroupController@store')->name('admin.auth_group.store');
	//编辑
	Route::get('/auth_group/{id}/edit','AuthGroupController@edit')->name('admin.auth_group.edit');
	Route::put('/auth_group/{id}/update','AuthGroupController@update')->name('admin.auth_group.update');
	
	//配置规则
	Route::get('/auth_group/{id}/access','AuthGroupController@access')->name('admin.auth_group.access');
	Route::put('/auth_group/{id}/access_update','AuthGroupController@access_update')->name('admin.auth_group.access_update');
	
	
	//调整状态
	Route::put('/auth_group/{id}/status','AuthGroupController@status')->name('admin.auth_group.status');
	//单个删除
	Route::delete('/auth_group/destroy','AuthGroupController@destroy')->name('admin.auth_group.destroy');
	
	
    //权限列表
	Route::get('/auth_rule/index','AuthRuleController@index')->name('admin.auth_rule.index'); 
	Route::post('/auth_rule/data', 'AuthRuleController@data')->name('admin.auth_rule.data');
	//添加
	Route::get('/auth_rule/create','AuthRuleController@create')->name('admin.auth_rule.create');
	Route::post('/auth_rule/store','AuthRuleController@store')->name('admin.auth_rule.store');
	//添加子级
	Route::get('/auth_rule/{id}/create_sublevel','AuthRuleController@create_sublevel')->name('admin.auth_rule.create_sublevel'); 
	Route::post('/auth_rule/store_sublevel','AuthRuleController@store_sublevel')->name('admin.auth_rule.store_sublevel');
	//编辑
	Route::get('/auth_rule/{id}/edit','AuthRuleController@edit')->name('admin.auth_rule.edit');
	Route::put('/auth_rule/{id}/update','AuthRuleController@update')->name('admin.auth_rule.update');
	//菜单状态
	Route::put('/auth_rule/{id}/status','AuthRuleController@status')->name('admin.auth_rule.status');
	//是否验证权限
	Route::put('/auth_rule/{id}/auth_open','AuthRuleController@auth_open')->name('admin.auth_rule.auth_open');
	//排序
	Route::put('/auth_rule/{id}/sorts','AuthRuleController@sorts')->name('admin.auth_rule.sorts'); 	
	//单个删除
	Route::delete('/auth_rule/destroy','AuthRuleController@destroy')->name('admin.auth_rule.destroy');
	
	
	
	
	//图片管理
	Route::get('/picture/index','PictureController@index')->name('admin.picture.index'); 
	Route::get('/picture/data', 'PictureController@data')->name('admin.picture.data');
	//添加
	Route::get('/picture/create','PictureController@create')->name('admin.picture.create');
	Route::post('/picture/store','PictureController@store')->name('admin.picture.store');
	
	//编辑
	Route::get('/picture/{id}/edit','PictureController@edit')->name('admin.picture.edit');
	Route::put('/picture/{id}/update','PictureController@update')->name('admin.picture.update');
	//状态
	Route::put('/picture/{id}/status','PictureController@status')->name('admin.picture.status');
	//排序
	Route::put('/picture/{id}/sorts','PictureController@sorts')->name('admin.picture.sorts'); 	
	
	//单个删除
	Route::delete('/picture/destroy','PictureController@destroy')->name('admin.picture.destroy');
	
	//批量删除
	Route::delete('/picture/destroy_all','PictureController@destroy_all')->name('admin.picture.destroy_all');
	
	
	//图片列表
	Route::get('/image/index','ImageController@index')->name('admin.image.index'); 
	Route::get('/image/data', 'ImageController@data')->name('admin.image.data');
	//状态
	Route::put('/image/{id}/status','ImageController@status')->name('admin.image.status');
	//清理无用图片
	Route::delete('/image/destroy_all','ImageController@destroy_all')->name('admin.image.destroy_all');
	
	
	//系统配置
	Route::get('/config/index','ConfigController@index')->name('admin.config.index'); 
	//系统配置数据处理
	Route::put('/config/{id}/update','ConfigController@update')->name('admin.config.update');
	
	//邮件发送
	Route::get('/email/index','EmailController@index')->name('admin.email.index'); 
	//邮件发送数据处理
	Route::post('/email/store','EmailController@store')->name('admin.email.store');
	
	//省市区 
	Route::get('/area/index','AreaController@index')->name('admin.area.index'); 
	Route::get('/area/data', 'AreaController@data')->name('admin.area.data');
	//添加
	Route::get('/area/create','AreaController@create')->name('admin.area.create');
	Route::post('/area/store','AreaController@store')->name('admin.area.store');
	//编辑
	Route::get('/area/{id}/edit','AreaController@edit')->name('admin.area.edit');
	Route::put('/area/{id}/update','AreaController@update')->name('admin.area.update');
	//状态
	Route::put('/area/{id}/status','AreaController@status')->name('admin.area.status');
	//排序
	Route::put('/area/{id}/sorts','AreaController@sorts')->name('admin.area.sorts'); 	
	//单个删除
	Route::delete('/area/destroy','AreaController@destroy')->name('admin.area.destroy');
	//导入服务器数据
	Route::get('/area/import_data','AreaController@import_data')->name('admin.area.import_data');
	//导出数据
	Route::get('/area/export_data','AreaController@export_data')->name('admin.area.export_data');
	
	//会员管理
	Route::get('/user/index','UserController@index')->name('admin.user.index'); 
	Route::get('/user/data', 'UserController@data')->name('admin.user.data');
	//状态
	Route::put('/user/{id}/status','UserController@status')->name('admin.user.status');
	//单个删除
	Route::delete('/user/destroy','UserController@destroy')->name('admin.user.destroy');
	
	//字体管理
	Route::get('/icon/index','IconController@index')->name('admin.icon.index'); 
	
	//操作日志
	Route::get('/operation_log/index','OperationLogController@index')->name('admin.operation_log.index'); 
	Route::get('/operation_log/data', 'OperationLogController@data')->name('admin.operation_log.data');
	//单个删除
	Route::delete('/operation_log/destroy','OperationLogController@destroy')->name('admin.operation_log.destroy');
	
	//批量删除
	Route::delete('/operation_log/destroy_all','OperationLogController@destroy_all')->name('admin.operation_log.destroy_all');
});














